#include "Util.h"
#include <unistd.h>

#include <fstream>

namespace util {

int File::createIfAbsent(const std::string & path){
    std::fstream fs;
    fs.open(path, std::ios::binary|std::ios::in|std::ios::out);
    if(!fs.is_open()){
        fs.open(path, std::ios::out); 
        fs.close();
    }
    return 0; 
}
int File::remove(const std::string & path){
    return unlink(path.c_str());
}
bool File::isExist(const std::string & path){
   return 0 == access(path.c_str(), F_OK);
}

}
